else: |
print() |
length = len(result) |
n = str(n) |
result = runSQL("SELECT name,year_born FROM horrible_histories") |
if result[x][1] < 0: |
print("Name: " + result[x][0]) |
print("Year Born: " + n + "BC") |
n = str(n) |
for x in range(length): |
print("Year Born: " + n) |
n = result[x][1] |
n = result[x][1] * -1 |
    else: |
    print() |
length = len(result) |
        n = str(n) |
result = runSQL("SELECT name,year_born FROM horrible_histories") |
    if result[x][1] < 0: |
    print("Name: " + result[x][0]) |
        print("Year Born: " + n + "BC") |
        n = str(n) |
for x in range(length): |
        print("Year Born: " + n) |
        n = result[x][1] |
        n = result[x][1] * -1 |
1 | result = runSQL("SELECT name,year_born FROM horrible_histories") |
2 | length = len(result) |
3 | for x in range(length): |
4 |     print("Name: " + result[x][0]) |
5 |     if result[x][1] < 0: |
6 |         n = result[x][1] * -1 |
7 |         n = str(n) |
8 |         print("Year Born: " + n + "BC") |
9 |     else: |
10 |         n = result[x][1] |
11 |         n = str(n) |
12 |         print("Year Born: " + n) |
13 |     print() |
print(maximum) |
maximum = 0 |
currentName = result[x][0] |
print("Heighest Value:") |
if result[x][1] > maximum: |
for x in range(length): |
maximum = result[x][1] |
length = len(result) |
result = runSQL("SELECT name,year_born FROM horrible_histories") |
currentName = "" |
print(currentName) |
print(maximum) |
maximum = 0 |
        currentName = result[x][0] |
print("Heighest Value:") |
    if result[x][1] > maximum: |
for x in range(length): |
        maximum = result[x][1] |
length = len(result) |
result = runSQL("SELECT name,year_born FROM horrible_histories") |
currentName = "" |
print(currentName) |
1 | result = runSQL("SELECT name,year_born FROM horrible_histories") |
2 | length = len(result) |
3 | maximum = 0 |
4 | currentName = "" |
5 | for x in range(length): |
6 |     if result[x][1] > maximum: |
7 |         maximum = result[x][1] |
8 |         currentName = result[x][0] |
9 | print("Heighest Value:") |
10 | print(currentName) |
11 | print(maximum) |
print("Fame Factor: " + str(card[3])) |
card = result[r] |
card[1] = card[1] * -1 |
r = random.randint(0,len(result)) |
card[1] = str(card[1]) + "BC" |
print("Despicable Deeds: " + str(card[4])) |
if card[1] < 0: |
print("Age at Death: " + str(card[2])) |
import random |
print("Year Born: " + str(card[1])) |
print("Dreadful Death: " + str(card[5])) |
result = runSQL("SELECT name,year_born,age_at_death,fame_factor,despicable_deeds,dreadful_death FROM horrible_histories") |
print("Name: " + card[0]) |
print("Fame Factor: " + str(card[3])) |
card = result[r] |
  card[1] = card[1] * -1 |
r = random.randint(0,len(result)) |
  card[1] = str(card[1]) + "BC" |
print("Despicable Deeds: " + str(card[4])) |
if card[1] < 0: |
print("Age at Death: " + str(card[2])) |
import random |
print("Year Born: " + str(card[1])) |
print("Dreadful Death: " + str(card[5])) |
result = runSQL("SELECT name,year_born,age_at_death,fame_factor,despicable_deeds,dreadful_death FROM horrible_histories") |
print("Name: " + card[0]) |
1 | import random |
2 | |
3 | result = runSQL("SELECT name,year_born,age_at_death,fame_factor,despicable_deeds,dreadful_death FROM horrible_histories") |
4 | r = random.randint(0,len(result)) |
5 | card = result[r] |
6 | |
7 | if card[1] < 0: |
8 |   card[1] = card[1] * -1 |
9 |   card[1] = str(card[1]) + "BC" |
10 | |
11 | print("Name: " + card[0]) |
12 | print("Year Born: " + str(card[1])) |
13 | print("Age at Death: " + str(card[2])) |
14 | print("Fame Factor: " + str(card[3])) |
15 | print("Despicable Deeds: " + str(card[4])) |
16 | print("Dreadful Death: " + str(card[5])) |
i = int(i) |
print("Year Born: " + str(card[1])) |
print("Dreadful Death: " + str(card[5])) |
i = input() |
result = runSQL("SELECT name,year_born,age_at_death,fame_factor,despicable_deeds,dreadful_death FROM horrible_histories") |
card[1] = card[1] * -1 |
while True: |
print("Fame Factor: " + str(card[3])) |
if i > 0 and i < 31: |
card[1] = str(card[1]) + "BC" |
print("Pick a card between 1 and 30") |
card = result[i] |
break |
print("Despicable Deeds: " + str(card[4])) |
if i.isdigit(): |
print("Name: " + card[0]) |
if card[1] < 0: |
print("Age at Death: " + str(card[2])) |
    i = int(i) |
print("Year Born: " + str(card[1])) |
print("Dreadful Death: " + str(card[5])) |
  i = input() |
result = runSQL("SELECT name,year_born,age_at_death,fame_factor,despicable_deeds,dreadful_death FROM horrible_histories") |
  card[1] = card[1] * -1 |
while True: |
print("Fame Factor: " + str(card[3])) |
    if i > 0 and i < 31: |
  card[1] = str(card[1]) + "BC" |
  print("Pick a card between 1 and 30") |
card = result[i] |
      break |
print("Despicable Deeds: " + str(card[4])) |
  if i.isdigit(): |
print("Name: " + card[0]) |
if card[1] < 0: |
print("Age at Death: " + str(card[2])) |
1 | result = runSQL("SELECT name,year_born,age_at_death,fame_factor,despicable_deeds,dreadful_death FROM horrible_histories") |
2 | while True: |
3 |   print("Pick a card between 1 and 30") |
4 |   i = input() |
5 |   if i.isdigit(): |
6 |     i = int(i) |
7 |     if i > 0 and i < 31: |
8 |       break |
9 | card = result[i] |
10 | |
11 | if card[1] < 0: |
12 |   card[1] = card[1] * -1 |
13 |   card[1] = str(card[1]) + "BC" |
14 | |
15 | print("Name: " + card[0]) |
16 | print("Year Born: " + str(card[1])) |
17 | print("Age at Death: " + str(card[2])) |
18 | print("Fame Factor: " + str(card[3])) |
19 | print("Despicable Deeds: " + str(card[4])) |
20 | print("Dreadful Death: " + str(card[5])) |
print(str(t) + " cards will beat this value") |
t = len(result) |
i = input() |
result = runSQL("SELECT * FROM horrible_histories WHERE age_at_death > " + i) |
print("Enter an age at death") |
1 | print("Enter an age at death") |
2 | i = input() |
3 | result = runSQL("SELECT * FROM horrible_histories WHERE age_at_death > " + i) |
4 | t = len(result) |
5 | print(str(t) + " cards will beat this value") |
for x in range(21): |
t = len(result) |
result = runSQL("SELECT * FROM horrible_histories WHERE despicable_deeds = " + str(x)) |
print(str(x) + " " + str(t)) |
for x in range(21): |
    t = len(result) |
    result = runSQL("SELECT * FROM horrible_histories WHERE despicable_deeds = " + str(x)) |
    print(str(x) + " " + str(t)) |
1 | for x in range(21): |
2 |     result = runSQL("SELECT * FROM horrible_histories WHERE despicable_deeds = " + str(x)) |
3 |     t = len(result) |
4 |     print(str(x) + " " + str(t)) |
5 |      |
nameList.append(results[x][0]) |
result = runSQL("SELECT name,year_born,age_at_death,fame_factor,despicable_deeds,dreadful_death FROM horrible_histories WHERE id = " + str(idx + 1)) |
idx = nameList.index(n) |
card = result[0] |
print("Fame Factor: " + str(card[3])) |
if card[1] < 0: |
print("Enter a name") |
print(results[x][0]) |
print("Name: " + card[0]) |
card[1] = str(card[1]) + "BC" |
print("Despicable Deeds: " + str(card[4])) |
results = runSQL("SELECT name FROM horrible_histories") |
for x in range(len(results)): |
n = input() |
nameList = [] |
print("Age at Death: " + str(card[2])) |
card[1] = card[1] * -1 |
print("Year Born: " + str(card[1])) |
print("See a list of all names in the deck:") |
print("Dreadful Death: " + str(card[5])) |
  nameList.append(results[x][0]) |
result = runSQL("SELECT name,year_born,age_at_death,fame_factor,despicable_deeds,dreadful_death FROM horrible_histories WHERE id = " + str(idx + 1)) |
idx = nameList.index(n) |
card = result[0] |
print("Fame Factor: " + str(card[3])) |
if card[1] < 0: |
print("Enter a name") |
  print(results[x][0]) |
print("Name: " + card[0]) |
  card[1] = str(card[1]) + "BC" |
print("Despicable Deeds: " + str(card[4])) |
results = runSQL("SELECT name FROM horrible_histories") |
for x in range(len(results)): |
n = input() |
nameList = [] |
print("Age at Death: " + str(card[2])) |
  card[1] = card[1] * -1 |
print("Year Born: " + str(card[1])) |
print("See a list of all names in the deck:") |
print("Dreadful Death: " + str(card[5])) |
1 | results = runSQL("SELECT name FROM horrible_histories") |
2 | print("See a list of all names in the deck:") |
3 | nameList = [] |
4 | for x in range(len(results)): |
5 |   nameList.append(results[x][0]) |
6 |   print(results[x][0]) |
7 | print("Enter a name") |
8 | n = input() |
9 | idx = nameList.index(n) |
10 | |
11 | result = runSQL("SELECT name,year_born,age_at_death,fame_factor,despicable_deeds,dreadful_death FROM horrible_histories WHERE id = " + str(idx + 1)) |
12 | card = result[0] |
13 | if card[1] < 0: |
14 |   card[1] = card[1] * -1 |
15 |   card[1] = str(card[1]) + "BC" |
16 | |
17 | print("Name: " + card[0]) |
18 | print("Year Born: " + str(card[1])) |
19 | print("Age at Death: " + str(card[2])) |
20 | print("Fame Factor: " + str(card[3])) |
21 | print("Despicable Deeds: " + str(card[4])) |
22 | print("Dreadful Death: " + str(card[5])) |
card[6] = str(card[6]) + "BC" |
print("Age at Death: " + str(card[7])) |
print("Fame Factor: " + str(card[8])) |
print("Dreadful Death: " + str(card[10])) |
card = results[r] |
r = random.randint(0,len(results)-1) |
card[6] = card[6] * -1 |
print("Year Born: " + str(card[6])) |
print("------------------------------------") |
print(card[1]) |
print("------------------------------------") |
results = runSQL("SELECT * FROM horrible_histories") |
print("------------------------------------") |
print(card[2] + " " + str(card[3]) + "-" + str(card[4])) |
print("Despicable Deeds: " + str(card[9])) |
print(card[5]) |
print("------------------------------------") |
if card[6] < 0: |
  card[6] = str(card[6]) + "BC" |
print("Age at Death: " + str(card[7])) |
print("Fame Factor: " + str(card[8])) |
print("Dreadful Death: " + str(card[10])) |
card = results[r] |
r = random.randint(0,len(results)-1) |
  card[6] = card[6] * -1 |
print("Year Born: " + str(card[6])) |
print("------------------------------------") |
print(card[1]) |
print("------------------------------------") |
results = runSQL("SELECT * FROM horrible_histories") |
print("------------------------------------") |
print(card[2] + " " + str(card[3]) + "-" + str(card[4])) |
print("Despicable Deeds: " + str(card[9])) |
print(card[5]) |
print("------------------------------------") |
if card[6] < 0: |
1 | results = runSQL("SELECT * FROM horrible_histories") |
2 | r = random.randint(0,len(results)-1) |
3 | card = results[r] |
4 | if card[6] < 0: |
5 |   card[6] = card[6] * -1 |
6 |   card[6] = str(card[6]) + "BC" |
7 | |
8 | print("------------------------------------") |
9 | print(card[1]) |
10 | print(card[2] + " " + str(card[3]) + "-" + str(card[4])) |
11 | print("------------------------------------") |
12 | print(card[5]) |
13 | print("------------------------------------") |
14 | print("Year Born: " + str(card[6])) |
15 | print("Age at Death: " + str(card[7])) |
16 | print("Fame Factor: " + str(card[8])) |
17 | print("Despicable Deeds: " + str(card[9])) |
18 | print("Dreadful Death: " + str(card[10])) |
19 | print("------------------------------------") |
print("|-----------------------------------------------------|") |
currentCount = 0 |
for x in range(len(currDesc)): |
card[6] = str(card[6]) + "BC" |
currentCount = 0 |
r = random.randint(0,len(results)-1) |
print(desc) |
if card[6] < 0: |
print("| " + card[1].ljust(52) + "|") |
print(("| Despicable Deeds: " + str(card[9])).ljust(54) + "|") |
if currDesc[x] == " ": |
print(("| Age at Death: " + str(card[7])).ljust(54) + "|") |
card[6] = card[6] * -1 |
print("| ----------------------------------------------------|") |
title = card[2] + " " + str(card[3]) + "-" + str(card[4]) |
print(("| Year Born: " + str(card[6])).ljust(54) + "|" ) |
results = runSQL("SELECT * FROM horrible_histories") |
lastspace = x + 1 |
desc = desc + ("| " + currDesc[start:lastspace]).ljust(54) + "|" + "\n" |
currDesc = card[5] |
print("| ----------------------------------------------------|") |
print("| " + title.ljust(52) + "|") |
currentCount = currentCount + 1 |
start = 0 |
print("|-----------------------------------------------------|") |
desc = desc + ("| " + currDesc[start:]).ljust(54) + "|" |
lastspace = 0 |
card = results[r] |
desc = "" |
print(("| Dreadful Death: " + str(card[10])).ljust(54) + "|") |
start = lastspace |
if currentCount == 40: |
print(("| Fame Factor: " + str(card[8])).ljust(54) + "|") |
print("|-----------------------------------------------------|") |
currentCount = 0 |
for x in range(len(currDesc)): |
  card[6] = str(card[6]) + "BC" |
    currentCount = 0 |
r = random.randint(0,len(results)-1) |
print(desc) |
if card[6] < 0: |
print("| " + card[1].ljust(52) + "|") |
print(("| Despicable Deeds: " + str(card[9])).ljust(54) + "|") |
  if currDesc[x] == " ": |
print(("| Age at Death: " + str(card[7])).ljust(54) + "|") |
  card[6] = card[6] * -1 |
print("| ----------------------------------------------------|") |
title = card[2] + " " + str(card[3]) + "-" + str(card[4]) |
print(("| Year Born: " + str(card[6])).ljust(54) + "|" ) |
results = runSQL("SELECT * FROM horrible_histories") |
    lastspace = x + 1 |
    desc = desc + ("| " + currDesc[start:lastspace]).ljust(54) + "|" + "\n" |
currDesc = card[5] |
print("| ----------------------------------------------------|") |
print("| " + title.ljust(52) + "|") |
  currentCount = currentCount + 1 |
start = 0 |
print("|-----------------------------------------------------|") |
desc = desc + ("| " + currDesc[start:]).ljust(54) + "|" |
lastspace = 0 |
card = results[r] |
desc = "" |
print(("| Dreadful Death: " + str(card[10])).ljust(54) + "|") |
    start = lastspace |
  if currentCount == 40: |
print(("| Fame Factor: " + str(card[8])).ljust(54) + "|") |
1 | results = runSQL("SELECT * FROM horrible_histories") |
2 | r = random.randint(0,len(results)-1) |
3 | card = results[r] |
4 | if card[6] < 0: |
5 |   card[6] = card[6] * -1 |
6 |   card[6] = str(card[6]) + "BC" |
7 | |
8 | currDesc = card[5] |
9 | desc = "" |
10 | currentCount = 0 |
11 | lastspace = 0 |
12 | start = 0 |
13 | for x in range(len(currDesc)): |
14 |   if currDesc[x] == " ": |
15 |     lastspace = x + 1 |
16 |   currentCount = currentCount + 1 |
17 |   if currentCount == 40: |
18 |     desc = desc + ("| " + currDesc[start:lastspace]).ljust(54) + "|" + "\n" |
19 |     start = lastspace |
20 |     currentCount = 0 |
21 | desc = desc + ("| " + currDesc[start:]).ljust(54) + "|" |
22 | print("|-----------------------------------------------------|") |
23 | print("| " + card[1].ljust(52) + "|") |
24 | title = card[2] + " " + str(card[3]) + "-" + str(card[4]) |
25 | print("| " + title.ljust(52) + "|") |
26 | print("| ----------------------------------------------------|") |
27 | print(desc) |
28 | print("| ----------------------------------------------------|") |
29 | print(("| Year Born: " + str(card[6])).ljust(54) + "|" ) |
30 | print(("| Age at Death: " + str(card[7])).ljust(54) + "|") |
31 | print(("| Fame Factor: " + str(card[8])).ljust(54) + "|") |
32 | print(("| Despicable Deeds: " + str(card[9])).ljust(54) + "|") |
33 | print(("| Dreadful Death: " + str(card[10])).ljust(54) + "|") |
34 | print("|-----------------------------------------------------|") |
print(card[1]) |
results = runSQL("SELECT * FROM horrible_histories") |
print("Dreadful Death: " + str(card[10])+ " (" + str(deathperc) + "%)") |
card[6] = str(card[6]) + "BC" |
ageperc = round(len(age)/29 * 100,1) |
fame = runSQL("SELECT * FROM horrible_histories WHERE fame_factor >" + str(card[8])) |
print("------------------------------------") |
year = runSQL("SELECT * FROM horrible_histories WHERE year_born >" + str(card[6])) |
if card[6] < 0: |
age = runSQL("SELECT * FROM horrible_histories WHERE age_at_death >" + str(card[7])) |
print(card[5]) |
print("Year Born: " + str(card[6]) + " (" + str(yearperc) + "%)") |
card[6] = card[6] * -1 |
print("------------------------------------") |
print(card[2] + " " + str(card[3]) + "-" + str(card[4])) |
r = random.randint(0,len(results)-1) |
print("Fame Factor: " + str(card[8])+ " (" + str(fameperc) + "%)") |
death = runSQL("SELECT * FROM horrible_histories WHERE dreadful_death >" + str(card[10])) |
yearperc = round(len(year)/29 * 100,1) |
print("------------------------------------") |
deedperc = round(len(deed)/29 * 100,1) |
card = results[r] |
fameperc = round(len(fame)/29 * 100,1) |
print("Age at Death: " + str(card[7])+ " (" + str(ageperc) + "%)") |
print("------------------------------------") |
print("Despicable Deeds: " + str(card[9])+ " (" + str(deedperc) + "%)") |
deathperc = round(len(death)/29 * 100,1) |
deed = runSQL("SELECT * FROM horrible_histories WHERE despicable_deeds >" + str(card[9])) |
print(card[1]) |
results = runSQL("SELECT * FROM horrible_histories") |
print("Dreadful Death: " + str(card[10])+ " (" + str(deathperc) + "%)") |
  card[6] = str(card[6]) + "BC" |
ageperc = round(len(age)/29 * 100,1) |
fame = runSQL("SELECT * FROM horrible_histories WHERE fame_factor >" + str(card[8])) |
print("------------------------------------") |
year = runSQL("SELECT * FROM horrible_histories WHERE year_born >" + str(card[6])) |
if card[6] < 0: |
age = runSQL("SELECT * FROM horrible_histories WHERE age_at_death >" + str(card[7])) |
print(card[5]) |
print("Year Born: " + str(card[6]) + " (" + str(yearperc) + "%)") |
  card[6] = card[6] * -1 |
print("------------------------------------") |
print(card[2] + " " + str(card[3]) + "-" + str(card[4])) |
r = random.randint(0,len(results)-1) |
print("Fame Factor: " + str(card[8])+ " (" + str(fameperc) + "%)") |
death = runSQL("SELECT * FROM horrible_histories WHERE dreadful_death >" + str(card[10])) |
yearperc = round(len(year)/29 * 100,1) |
print("------------------------------------") |
deedperc = round(len(deed)/29 * 100,1) |
card = results[r] |
fameperc = round(len(fame)/29 * 100,1) |
print("Age at Death: " + str(card[7])+ " (" + str(ageperc) + "%)") |
print("------------------------------------") |
print("Despicable Deeds: " + str(card[9])+ " (" + str(deedperc) + "%)") |
deathperc = round(len(death)/29 * 100,1) |
deed = runSQL("SELECT * FROM horrible_histories WHERE despicable_deeds >" + str(card[9])) |
1 | results = runSQL("SELECT * FROM horrible_histories") |
2 | r = random.randint(0,len(results)-1) |
3 | card = results[r] |
4 | year = runSQL("SELECT * FROM horrible_histories WHERE year_born >" + str(card[6])) |
5 | yearperc = round(len(year)/29 * 100,1) |
6 | age = runSQL("SELECT * FROM horrible_histories WHERE age_at_death >" + str(card[7])) |
7 | ageperc = round(len(age)/29 * 100,1) |
8 | fame = runSQL("SELECT * FROM horrible_histories WHERE fame_factor >" + str(card[8])) |
9 | fameperc = round(len(fame)/29 * 100,1) |
10 | deed = runSQL("SELECT * FROM horrible_histories WHERE despicable_deeds >" + str(card[9])) |
11 | deedperc = round(len(deed)/29 * 100,1) |
12 | death = runSQL("SELECT * FROM horrible_histories WHERE dreadful_death >" + str(card[10])) |
13 | deathperc = round(len(death)/29 * 100,1) |
14 | |
15 | if card[6] < 0: |
16 |   card[6] = card[6] * -1 |
17 |   card[6] = str(card[6]) + "BC" |
18 | print("------------------------------------") |
19 | print(card[1]) |
20 | print(card[2] + " " + str(card[3]) + "-" + str(card[4])) |
21 | print("------------------------------------") |
22 | print(card[5]) |
23 | print("------------------------------------") |
24 | |
25 | print("Year Born: " + str(card[6]) + " (" + str(yearperc) + "%)") |
26 | print("Age at Death: " + str(card[7])+ " (" + str(ageperc) + "%)") |
27 | print("Fame Factor: " + str(card[8])+ " (" + str(fameperc) + "%)") |
28 | print("Despicable Deeds: " + str(card[9])+ " (" + str(deedperc) + "%)") |
29 | print("Dreadful Death: " + str(card[10])+ " (" + str(deathperc) + "%)") |
30 | print("------------------------------------") |
rounds = ["Name","Year Born","Age at death","Fame Factor","Despicable Deeds", "Dreadful Death"] |
r1 = random.randint(0,29) |
row = (rounds[x] + ": " + str(result[r1][x])).ljust(40) |
r2 = random.randint(0.29) |
for x in range(len(rounds)): |
result = runSQL("SELECT name,year_born,age_at_death,fame_factor,despicable_deeds,dreadful_death FROM horrible_histories") |
row = row + (rounds[x] + ": " + str(result[r2][x])) |
print(row) |
rounds = ["Name","Year Born","Age at death","Fame Factor","Despicable Deeds", "Dreadful Death"] |
r1 = random.randint(0,29) |
    row = (rounds[x] + ": " + str(result[r1][x])).ljust(40) |
r2 = random.randint(0.29) |
for x in range(len(rounds)): |
result = runSQL("SELECT name,year_born,age_at_death,fame_factor,despicable_deeds,dreadful_death FROM horrible_histories") |
    row = row + (rounds[x] + ": " + str(result[r2][x])) |
    print(row) |
1 | result = runSQL("SELECT name,year_born,age_at_death,fame_factor,despicable_deeds,dreadful_death FROM horrible_histories") |
2 | r1 = random.randint(0,29) |
3 | r2 = random.randint(0.29) |
4 | rounds = ["Name","Year Born","Age at death","Fame Factor","Despicable Deeds", "Dreadful Death"] |
5 | for x in range(len(rounds)): |
6 |     row = (rounds[x] + ": " + str(result[r1][x])).ljust(40) |
7 |     row = row + (rounds[x] + ": " + str(result[r2][x])) |
8 |     print(row) |
9 |      |
rounds = ["Name","Year Born","Age At Death","Fame Factor","Despicable Deeds","Dreadful Death"] |
#id,name,title,born,died,description,year_born,age_at_death,fame_factor,despicable_deeds,dreadful_death |
row += (rounds[x] + ": " + str(result[r1][x])).ljust(40) |
print(row) |
idx = rounds.index(i) |
#all fields involving years has a negative number if it repesents BC e.g. -240 = 240BC |
while True: |
result = runSQL("SELECT name,year_born,age_at_death,fame_factor,despicable_deeds,dreadful_death FROM horrible_histories") |
rounds = ["Name","Year Born","Age At Death","Fame Factor","Despicable Deeds","Dreadful Death"] |
print("You win!") |
row = "" |
if result[r1][idx] > result[r2][idx]: |
row += (rounds[x] + ": " + str(result[r1][x])).ljust(40) |
row += rounds[x] + ": " + str(result[r2][x]) |
r1 = random.randint(0,29) |
from databaseConnect import runSQL |
#Some Notes: |
print("You lost") |
row = "" |
row += rounds[x] + ": " + "??" |
else: |
#Column Names: |
for x in range(len(rounds)): |
for x in range(len(rounds)): |
if i in rounds and i != "Name": |
print(row) |
print("It's a draw!") |
r2 = random.randint(0,29) |
print("Select an option:") |
if result[r1][idx] == result[r2][idx]: |
import random |
break |
i = i.title() |
i = input() |
rounds = ["Name","Year Born","Age At Death","Fame Factor","Despicable Deeds","Dreadful Death"] |
#id,name,title,born,died,description,year_born,age_at_death,fame_factor,despicable_deeds,dreadful_death |
  row += (rounds[x] + ": " + str(result[r1][x])).ljust(40) |
  print(row) |
idx = rounds.index(i) |
#all fields involving years has a negative number if it repesents BC e.g. -240 = 240BC |
while True: |
result = runSQL("SELECT name,year_born,age_at_death,fame_factor,despicable_deeds,dreadful_death FROM horrible_histories") |
rounds = ["Name","Year Born","Age At Death","Fame Factor","Despicable Deeds","Dreadful Death"] |
  print("You win!") |
  row = "" |
if result[r1][idx] > result[r2][idx]: |
  row += (rounds[x] + ": " + str(result[r1][x])).ljust(40) |
  row += rounds[x] + ": " + str(result[r2][x]) |
r1 = random.randint(0,29) |
from databaseConnect import runSQL |
#Some Notes: |
  print("You lost") |
  row = "" |
  row += rounds[x] + ": " + "??" |
else: |
#Column Names: |
for x in range(len(rounds)): |
for x in range(len(rounds)): |
  if i in rounds and i != "Name": |
  print(row) |
  print("It's a draw!") |
r2 = random.randint(0,29) |
print("Select an option:") |
if result[r1][idx] == result[r2][idx]: |
import random |
    break |
  i = i.title() |
  i = input() |
1 | from databaseConnect import runSQL |
2 | import random |
3 | #Column Names: |
4 | #id,name,title,born,died,description,year_born,age_at_death,fame_factor,despicable_deeds,dreadful_death |
5 |    |
6 | #Some Notes: |
7 | #all fields involving years has a negative number if it repesents BC e.g. -240 = 240BC |
8 | result = runSQL("SELECT name,year_born,age_at_death,fame_factor,despicable_deeds,dreadful_death FROM horrible_histories") |
9 | r1 = random.randint(0,29) |
10 | r2 = random.randint(0,29) |
11 | rounds = ["Name","Year Born","Age At Death","Fame Factor","Despicable Deeds","Dreadful Death"] |
12 | for x in range(len(rounds)): |
13 |   row = "" |
14 |   row += (rounds[x] + ": " + str(result[r1][x])).ljust(40) |
15 |   row += rounds[x] + ": " + "??" |
16 |   print(row) |
17 | print("Select an option:") |
18 | while True: |
19 |   i = input() |
20 |   i = i.title() |
21 |   if i in rounds and i != "Name": |
22 |     break |
23 |      |
24 | rounds = ["Name","Year Born","Age At Death","Fame Factor","Despicable Deeds","Dreadful Death"] |
25 | for x in range(len(rounds)): |
26 |   row = "" |
27 |   row += (rounds[x] + ": " + str(result[r1][x])).ljust(40) |
28 |   row += rounds[x] + ": " + str(result[r2][x]) |
29 |   print(row) |
30 |    |
31 | idx = rounds.index(i) |
32 | if result[r1][idx] > result[r2][idx]: |
33 |   print("You win!") |
34 | if result[r1][idx] == result[r2][idx]: |
35 |   print("It's a draw!") |
36 | else: |
37 |   print("You lost") |
print("Good Luck!") |
1 | print("Good Luck!") |